#define _CRT_SECURE_NO_WARNINGS 1


#include<math.h>
#include<iostream>

using namespace std;

int integerBreak(int n)
{
    if (n < 4)
    {
        return n - 1;
    }
    int ret = n / 3;
    int mod = n % 3;
    if (mod == 0)
    {
        return pow(3, ret);
    }
    else if (mod == 1)
    {
        return pow(3, ret - 1) * 4;
    }
    else
    {
        return pow(3, ret) * 2;
    }
}